﻿using System.Collections.ObjectModel;

namespace CodePlex.PropertyDesigner
{
    public class ClassDesignerData
    {
        public ClassDesignerData()
        {
            Properties = new ClassInfoPropertiesCollection();
        }

        public string Namespace { get; set; }
        public string Name { get; set; }
        public ClassInfoPropertiesCollection Properties { get; private set; }
    }

    public class ClassInfoPropertiesCollection : Collection<PropertyDesignerData>
    {
    }

    public class PropertyDesignerData
    {
        public string Name { get; set; }
        public string TypeNamespace { get; set; }
        public string TypeName { get; set; }
        public PropertyAccessModifier AccessModifier { get; set; }
        public PropertyInheritanceModifier InheritanceModifier { get; set; }
        public PropertyEqualityCheck EqualityCheck { get; set; }
    }

    public enum PropertyAccessModifier
    {
        Public,
        Private,
        Internal,
    }

    public enum PropertyInheritanceModifier
    {
        None,
        Abstract,
        Virtual,
        Sealed
    }

    public enum PropertyEqualityCheck
    {
        Equals,
        ReferenceEquals,
        None
    }

    public class ClassDesignerDataSample : ClassDesignerData
    {
        public ClassDesignerDataSample()
        {
            Namespace = "SampleNamespace";
            Name = "SampleClass";
            Properties.Add(
                new PropertyDesignerData
                    {
                        Name = "SampleProperty1",
                        TypeNamespace = "System",
                        TypeName = "String"
                    });
            Properties.Add(
                new PropertyDesignerData
                    {
                        Name = "SampleProperty2",
                        TypeNamespace = "System",
                        TypeName = "Int32",
                        AccessModifier = PropertyAccessModifier.Private,
                        InheritanceModifier = PropertyInheritanceModifier.Abstract
                    });
            Properties.Add(
                new PropertyDesignerData
                    {
                        Name = "SampleProperty2",
                        TypeNamespace = "System",
                        TypeName = "Object",
                        EqualityCheck = PropertyEqualityCheck.ReferenceEquals
                    });
        }
    }
}
